<!DOCTYPE html><html><head><title>README</title><link href="http://www.jboss.org/jdf/stylesheets/documentation.css" rel="stylesheet"></link><link href="http://www.jboss.org/jdf/stylesheets/pygments.css" rel="stylesheet"></link></head><body>
<h1><a id="wsbacoordinatorcompletionsimple-example-of-a-wsba-ws-business-activity-enabled-jaxws-web-service" class="anchor" href="#wsbacoordinatorcompletionsimple-example-of-a-wsba-ws-business-activity-enabled-jaxws-web-service"><span class="anchor-icon"></span></a>wsba-coordinator-completion-simple: Example of a WS-BA (WS Business Activity) Enabled JAX-WS Web Service</h1>

<p>Author: Paul Robinson<br/>
Level: Intermediate<br/>
Technologies: WS-BA, JAX-WS<br/>
Summary:  Deployment of a WS-BA (WS-BusinessActivity) enabled JAX-WS Web service bundled in a WAR archive (Participant Completion protocol)<br/>
Target Product: EAP<br/>
Product Versions: EAP 6.1, EAP 6.2<br/>
Source: <a href="https://github.com/jboss-developer/jboss-eap-quickstarts/">https://github.com/jboss-developer/jboss-eap-quickstarts/</a>  </p>

<h2><a id="what-is-it" class="anchor" href="#what-is-it"><span class="anchor-icon"></span></a>What is it?</h2>

<p>This example demonstrates the deployment of a WS-BA (WS Business Activity) enabled JAX-WS Web service bundled in a WAR archive for deployment to Red Hat JBoss Enterprise Application Platform.</p>

<p>The Web service exposes a simple &lsquo;set&rsquo; collection as a service. The Service allows items to be added to the set within a Business Activity.</p>

<p>This example demonstrates the basics of implementing a WS-BA enabled Web service. It is beyond the scope of this quick start to demonstrate more advanced features. In particular:</p>

<ol>
<li>The Service does not implement the required hooks to support recovery in the presence of failures.</li>
<li>It also does not utilize a transactional back end resource.</li>
<li>Only one Web service participates in the protocol. As WS-BA is a coordination protocol, it is best suited to multi-participant scenarios.</li>
</ol>

<p>For a more complete example, please see the XTS demonstrator application that ships with the JBossTS project: <a href="http://www.jboss.org/jbosstm">http://www.jboss.org/jbosstm</a>.</p>

<p>It is also assumed that you have an understanding of WS-BusinessActivity. For more details, read the XTS documentation that ships with the JBossTS project, which can be downloaded here: <a href="http://www.jboss.org/jbosstm/downloads/JBOSSTS_4_16_0_Final">http://www.jboss.org/jbosstm/downloads/JBOSSTS_4_16_0_Final</a></p>

<p>The application consists of a single JAX-WS web service that is deployed within a WAR archive. It is tested with a JBoss Arquillian enabled JUnit test.</p>

<p>When running the org.jboss.as.quickstarts.wsba.coordinatorcompletion.simple.ClientTest#testSuccess() method, the following steps occur:</p>

<ol>
<li>A new Business Activity is created by the client.</li>
<li>Multiple operations on a WS-BA enabled Web service is invoked by the client.</li>
<li>The <code>JaxWSHeaderContextProcessor</code> in the WS Client handler chain inserts the BA context into the outgoing SOAP messages.</li>
<li>When the service receives a SOAP request, the <code>JaxWSHeaderContextProcessor</code> in its handler chain inspects the BA context and associates the request with this BA.</li>
<li>The Web service operation is invoked.</li>
<li>For the first request, in this BA, A participant is enlisted in this BA. This allows the Web Service logic to respond to protocol events, such as compensate and close.</li>
<li>The service invokes the business logic. In this case, a String value is added to the set.</li>
<li>The client can then make additional calls to the <code>SetService</code>. As the <code>SetService</code> participates as a <code>CoordinatorCompletion</code> protocol, it will continue to accept calls to <code>addValueToSet</code> until it is told to complete by the coordinator.</li>
<li>The client can then decide to complete or cancel the BA. 

<ul>
<li>If the client decides to complete, all participants will be told to complete. Providing all participants successfully complete, the coordinator will then tell all participants to close, otherwise the completed participants will be told to compensate.</li>
<li>If the participant decides to cancel, all participants will be told to compensate.</li>
</ul></li>
</ol>

<p>There is another test that shows how the client can cancel a BA.</p>

<h2><a id="system-requirements" class="anchor" href="#system-requirements"><span class="anchor-icon"></span></a>System requirements</h2>

<p>The application this project produces is designed to be run on Red Hat JBoss Enterprise Application Platform 6.1 or later. </p>

<p>All you need to build this project is Java 6.0 (Java SDK 1.6) or later, Maven 3.0 or later.</p>

<h2><a id="configure-maven" class="anchor" href="#configure-maven"><span class="anchor-icon"></span></a>Configure Maven</h2>

<p>If you have not yet done so, you must <a href="../README.html#configure-maven">Configure Maven</a> before testing the quickstarts.</p>

<h2><a id="start-the-jboss-server-with-the-custom-options" class="anchor" href="#start-the-jboss-server-with-the-custom-options"><span class="anchor-icon"></span></a>Start the JBoss Server with the Custom Options</h2>

<p>Next you need to start JBoss EAP with the XTS sub system enabled. This is enabled through the optional server configuration <em>standalone-xts.xml</em>. To do this, run the following commands from the top-level directory of JBossAS:</p>
<div class="highlight"><pre>    <span class="n">For</span> <span class="n">Linux</span><span class="o">:</span>     <span class="p">.</span><span class="o">/</span><span class="n">bin</span><span class="o">/</span><span class="n">standalone</span><span class="p">.</span><span class="n">sh</span> <span class="o">--</span><span class="n">server</span><span class="o">-</span><span class="n">config</span><span class="o">=</span><span class="p">..</span><span class="o">/</span><span class="p">..</span><span class="o">/</span><span class="n">docs</span><span class="o">/</span><span class="n">examples</span><span class="o">/</span><span class="n">configs</span><span class="o">/</span><span class="n">standalone</span><span class="o">-</span><span class="n">xts</span><span class="p">.</span><span class="n">xml</span> <span class="o">|</span> <span class="n">egrep</span> <span class="s">&quot;started|stdout&quot;</span>
    <span class="n">For</span> <span class="n">Windows</span><span class="o">:</span>   <span class="err">\</span><span class="n">bin</span><span class="err">\</span><span class="n">standalone</span><span class="p">.</span><span class="n">bat</span> <span class="o">--</span><span class="n">server</span><span class="o">-</span><span class="n">config</span><span class="o">=</span><span class="p">..</span><span class="err">\</span><span class="p">..</span><span class="err">\</span><span class="n">docs</span><span class="err">\</span><span class="n">examples</span><span class="err">\</span><span class="n">configs</span><span class="err">\</span><span class="n">standalone</span><span class="o">-</span><span class="n">xts</span><span class="p">.</span><span class="n">xml</span> <span class="o">|</span> <span class="n">egrep</span> <span class="s">&quot;started|stdout&quot;</span>
</pre></div>
<p>Note, the pipe to egrep (| egrep &ldquo;started|stdout&rdquo;) is useful to just show when the server has started and the output from these tests. For normal operation, this pipe can be removed.</p>

<h2><a id="run-the-arquillian-tests-" class="anchor" href="#run-the-arquillian-tests-"><span class="anchor-icon"></span></a>Run the Arquillian Tests </h2>

<p>This quickstart provides Arquillian tests. By default, these tests are configured to be skipped as Arquillian tests require the use of a container. </p>

<p><em>NOTE: The following commands assume you have configured your Maven user settings. If you have not, you must include Maven setting arguments on the command line. See <a href="../README.html#run-the-arquillian-tests">Run the Arquillian Tests</a> for complete instructions and additional options.</em></p>

<ol>
<li>Make sure you have started the JBoss Server as described above.</li>
<li>Open a command line and navigate to the root directory of this quickstart.</li>
<li><p>Type the following command to run the test goal with the following profile activated:</p>
<div class="highlight"><pre><span class="n">mvn</span> <span class="n">clean</span> <span class="n">test</span> <span class="o">-</span><span class="n">Parq</span><span class="o">-</span><span class="n">jbossas</span><span class="o">-</span><span class="n">remote</span> 
</pre></div></li>
</ol>

<h2><a id="investigate-the-server-log" class="anchor" href="#investigate-the-server-log"><span class="anchor-icon"></span></a>Investigate the Server Log</h2>

<p>The following messages should appear in the server log. Note there may be other log messages interlaced between these. The messages trace the steps taken by the tests.</p>

<p>Test success:</p>
<div class="highlight"><pre><span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">191</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">management</span><span class="o">-</span><span class="n">handler</span><span class="o">-</span><span class="n">threads</span> <span class="o">-</span> <span class="mi">10</span><span class="o">)</span> <span class="n">Starting</span> <span class="s1">&#39;testSuccess&#39;</span><span class="o">.</span> <span class="n">This</span> <span class="n">test</span> <span class="n">invokes</span> <span class="n">a</span> <span class="n">WS</span> <span class="n">twice</span> <span class="n">within</span> <span class="n">a</span> <span class="n">BA</span><span class="o">.</span> <span class="n">The</span> <span class="n">BA</span> <span class="k">is</span> <span class="n">later</span> <span class="n">closes</span><span class="o">,</span> <span class="n">which</span> <span class="n">causes</span> <span class="n">these</span> <span class="n">WS</span> <span class="n">calls</span> <span class="n">to</span> <span class="n">complete</span> <span class="n">successfully</span><span class="o">.</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">191</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">management</span><span class="o">-</span><span class="n">handler</span><span class="o">-</span><span class="n">threads</span> <span class="o">-</span> <span class="mi">10</span><span class="o">)</span> <span class="o">[</span><span class="n">CLIENT</span><span class="o">]</span> <span class="n">Creating</span> <span class="n">a</span> <span class="k">new</span> <span class="n">Business</span> <span class="n">Activity</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">192</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">management</span><span class="o">-</span><span class="n">handler</span><span class="o">-</span><span class="n">threads</span> <span class="o">-</span> <span class="mi">10</span><span class="o">)</span> <span class="o">[</span><span class="n">CLIENT</span><span class="o">]</span> <span class="n">Beginning</span> <span class="n">Business</span> <span class="n">Activity</span> <span class="o">(</span><span class="n">All</span> <span class="n">calls</span> <span class="n">to</span> <span class="n">Web</span> <span class="n">services</span> <span class="n">that</span> <span class="n">support</span> <span class="n">WS</span><span class="o">-</span><span class="n">BA</span> <span class="n">wil</span> <span class="n">be</span> <span class="n">included</span> <span class="k">in</span> <span class="k">this</span> <span class="n">activity</span><span class="o">)</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">216</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">management</span><span class="o">-</span><span class="n">handler</span><span class="o">-</span><span class="n">threads</span> <span class="o">-</span> <span class="mi">10</span><span class="o">)</span> <span class="o">[</span><span class="n">CLIENT</span><span class="o">]</span> <span class="n">invoking</span> <span class="n">addValueToSet</span><span class="o">(</span><span class="mi">1</span><span class="o">)</span> <span class="n">on</span> <span class="n">WS</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">241</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">http</span><span class="o">-</span><span class="n">localhost</span><span class="o">-</span><span class="mf">127.0</span><span class="o">.</span><span class="mf">0.1</span><span class="o">-</span><span class="mi">8080</span><span class="o">-</span><span class="mi">2</span><span class="o">)</span> <span class="o">[</span><span class="n">SERVICE</span><span class="o">]</span> <span class="n">invoked</span> <span class="n">addValueToSet</span><span class="o">(</span><span class="s1">&#39;1&#39;</span><span class="o">)</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">241</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">http</span><span class="o">-</span><span class="n">localhost</span><span class="o">-</span><span class="mf">127.0</span><span class="o">.</span><span class="mf">0.1</span><span class="o">-</span><span class="mi">8080</span><span class="o">-</span><span class="mi">2</span><span class="o">)</span> <span class="o">[</span><span class="n">SERVICE</span><span class="o">]</span> <span class="n">Enlisting</span> <span class="n">a</span> <span class="n">participant</span> <span class="n">into</span> <span class="n">the</span> <span class="n">BA</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">281</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">http</span><span class="o">-</span><span class="n">localhost</span><span class="o">-</span><span class="mf">127.0</span><span class="o">.</span><span class="mf">0.1</span><span class="o">-</span><span class="mi">8080</span><span class="o">-</span><span class="mi">2</span><span class="o">)</span> <span class="o">[</span><span class="n">SERVICE</span><span class="o">]</span> <span class="n">Invoking</span> <span class="n">the</span> <span class="n">back</span><span class="o">-</span><span class="n">end</span> <span class="n">business</span> <span class="n">logic</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">283</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">management</span><span class="o">-</span><span class="n">handler</span><span class="o">-</span><span class="n">threads</span> <span class="o">-</span> <span class="mi">10</span><span class="o">)</span> <span class="o">[</span><span class="n">CLIENT</span><span class="o">]</span> <span class="n">invoking</span> <span class="n">addValueToSet</span><span class="o">(</span><span class="mi">2</span><span class="o">)</span> <span class="n">on</span> <span class="n">WS</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">308</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">http</span><span class="o">-</span><span class="n">localhost</span><span class="o">-</span><span class="mf">127.0</span><span class="o">.</span><span class="mf">0.1</span><span class="o">-</span><span class="mi">8080</span><span class="o">-</span><span class="mi">2</span><span class="o">)</span> <span class="o">[</span><span class="n">SERVICE</span><span class="o">]</span> <span class="n">invoked</span> <span class="n">addValueToSet</span><span class="o">(</span><span class="s1">&#39;2&#39;</span><span class="o">)</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">308</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">http</span><span class="o">-</span><span class="n">localhost</span><span class="o">-</span><span class="mf">127.0</span><span class="o">.</span><span class="mf">0.1</span><span class="o">-</span><span class="mi">8080</span><span class="o">-</span><span class="mi">2</span><span class="o">)</span> <span class="o">[</span><span class="n">SERVICE</span><span class="o">]</span> <span class="n">Re</span><span class="o">-</span><span class="n">using</span> <span class="n">the</span> <span class="n">existing</span> <span class="n">participant</span><span class="o">,</span> <span class="n">already</span> <span class="n">registered</span> <span class="k">for</span> <span class="k">this</span> <span class="n">BA</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">308</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">http</span><span class="o">-</span><span class="n">localhost</span><span class="o">-</span><span class="mf">127.0</span><span class="o">.</span><span class="mf">0.1</span><span class="o">-</span><span class="mi">8080</span><span class="o">-</span><span class="mi">2</span><span class="o">)</span> <span class="o">[</span><span class="n">SERVICE</span><span class="o">]</span> <span class="n">Invoking</span> <span class="n">the</span> <span class="n">back</span><span class="o">-</span><span class="n">end</span> <span class="n">business</span> <span class="n">logic</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">313</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">management</span><span class="o">-</span><span class="n">handler</span><span class="o">-</span><span class="n">threads</span> <span class="o">-</span> <span class="mi">10</span><span class="o">)</span> <span class="o">[</span><span class="n">CLIENT</span><span class="o">]</span> <span class="n">Closing</span> <span class="n">Business</span> <span class="n">Activity</span> <span class="o">(</span><span class="n">This</span> <span class="n">will</span> <span class="n">cause</span> <span class="n">the</span> <span class="n">BA</span> <span class="n">to</span> <span class="n">complete</span> <span class="n">successfully</span><span class="o">)</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">419</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">TaskWorker</span><span class="o">-</span><span class="mi">3</span><span class="o">)</span> <span class="o">[</span><span class="n">SERVICE</span><span class="o">]</span> <span class="n">Participant</span><span class="o">.</span><span class="na">complete</span> <span class="o">(</span><span class="n">This</span> <span class="n">tells</span> <span class="n">the</span> <span class="n">participant</span> <span class="n">that</span> <span class="n">the</span> <span class="n">BA</span> <span class="n">completed</span><span class="o">,</span> <span class="n">but</span> <span class="n">may</span> <span class="n">be</span> <span class="n">compensated</span> <span class="n">later</span><span class="o">)</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">498</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">TaskWorker</span><span class="o">-</span><span class="mi">3</span><span class="o">)</span> <span class="o">[</span><span class="n">SERVICE</span><span class="o">]</span> <span class="n">Participant</span><span class="o">.</span><span class="na">confirmCompleted</span><span class="o">(</span><span class="s1">&#39;true&#39;</span><span class="o">)</span> <span class="o">(</span><span class="n">This</span> <span class="n">tells</span> <span class="n">the</span> <span class="n">participant</span> <span class="n">that</span> <span class="n">compensation</span> <span class="n">information</span> <span class="n">has</span> <span class="n">been</span> <span class="n">logged</span> <span class="n">and</span> <span class="n">that</span> <span class="n">it</span> <span class="k">is</span> <span class="n">safe</span> <span class="n">to</span> <span class="n">commit</span> <span class="n">any</span> <span class="n">changes</span><span class="o">.)</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">498</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">TaskWorker</span><span class="o">-</span><span class="mi">3</span><span class="o">)</span> <span class="o">[</span><span class="n">SERVICE</span><span class="o">]</span> <span class="n">Commit</span> <span class="n">the</span> <span class="n">backend</span> <span class="n">resource</span> <span class="o">(</span><span class="n">e</span><span class="o">.</span><span class="na">g</span><span class="o">.</span> <span class="n">commit</span> <span class="n">any</span> <span class="n">changes</span> <span class="n">to</span> <span class="n">databases</span> <span class="n">so</span> <span class="n">that</span> <span class="n">they</span> <span class="n">are</span> <span class="n">visible</span> <span class="n">to</span> <span class="n">others</span><span class="o">)</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">543</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">TaskWorker</span><span class="o">-</span><span class="mi">1</span><span class="o">)</span> <span class="o">[</span><span class="n">SERVICE</span><span class="o">]</span> <span class="n">Participant</span><span class="o">.</span><span class="na">close</span> <span class="o">(</span><span class="n">The</span> <span class="n">participant</span> <span class="n">knows</span> <span class="n">that</span> <span class="k">this</span> <span class="n">BA</span> <span class="k">is</span> <span class="n">now</span> <span class="n">finished</span> <span class="n">and</span> <span class="n">can</span> <span class="k">throw</span> <span class="n">away</span> <span class="n">any</span> <span class="n">temporary</span> <span class="n">state</span><span class="o">)</span>
</pre></div>
<p>Test cancel:</p>
<div class="highlight"><pre><span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">616</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">management</span><span class="o">-</span><span class="n">handler</span><span class="o">-</span><span class="n">threads</span> <span class="o">-</span> <span class="mi">10</span><span class="o">)</span> <span class="n">Starting</span> <span class="s1">&#39;testCancel&#39;</span><span class="o">.</span> <span class="n">This</span> <span class="n">test</span> <span class="n">invokes</span> <span class="n">a</span> <span class="n">WS</span> <span class="n">twice</span> <span class="n">within</span> <span class="n">a</span> <span class="n">BA</span><span class="o">.</span> <span class="n">The</span> <span class="n">BA</span> <span class="k">is</span> <span class="n">later</span> <span class="n">cancelled</span><span class="o">,</span> <span class="n">which</span> <span class="n">causes</span> <span class="n">these</span> <span class="n">WS</span> <span class="n">calls</span> <span class="n">to</span> <span class="n">be</span> <span class="n">compensated</span><span class="o">.</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">616</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">management</span><span class="o">-</span><span class="n">handler</span><span class="o">-</span><span class="n">threads</span> <span class="o">-</span> <span class="mi">10</span><span class="o">)</span> <span class="o">[</span><span class="n">CLIENT</span><span class="o">]</span> <span class="n">Creating</span> <span class="n">a</span> <span class="k">new</span> <span class="n">Business</span> <span class="n">Activity</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">616</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">management</span><span class="o">-</span><span class="n">handler</span><span class="o">-</span><span class="n">threads</span> <span class="o">-</span> <span class="mi">10</span><span class="o">)</span> <span class="o">[</span><span class="n">CLIENT</span><span class="o">]</span> <span class="n">Beginning</span> <span class="n">Business</span> <span class="n">Activity</span> <span class="o">(</span><span class="n">All</span> <span class="n">calls</span> <span class="n">to</span> <span class="n">Web</span> <span class="n">services</span> <span class="n">that</span> <span class="n">support</span> <span class="n">WS</span><span class="o">-</span><span class="n">BA</span> <span class="n">will</span> <span class="n">be</span> <span class="n">included</span> <span class="k">in</span> <span class="k">this</span> <span class="n">activity</span><span class="o">)</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">631</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">management</span><span class="o">-</span><span class="n">handler</span><span class="o">-</span><span class="n">threads</span> <span class="o">-</span> <span class="mi">10</span><span class="o">)</span> <span class="o">[</span><span class="n">CLIENT</span><span class="o">]</span> <span class="n">invoking</span> <span class="n">addValueToSet</span><span class="o">(</span><span class="mi">1</span><span class="o">)</span> <span class="n">on</span> <span class="n">WS</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">653</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">http</span><span class="o">-</span><span class="n">localhost</span><span class="o">-</span><span class="mf">127.0</span><span class="o">.</span><span class="mf">0.1</span><span class="o">-</span><span class="mi">8080</span><span class="o">-</span><span class="mi">2</span><span class="o">)</span> <span class="o">[</span><span class="n">SERVICE</span><span class="o">]</span> <span class="n">invoked</span> <span class="n">addValueToSet</span><span class="o">(</span><span class="s1">&#39;1&#39;</span><span class="o">)</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">653</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">http</span><span class="o">-</span><span class="n">localhost</span><span class="o">-</span><span class="mf">127.0</span><span class="o">.</span><span class="mf">0.1</span><span class="o">-</span><span class="mi">8080</span><span class="o">-</span><span class="mi">2</span><span class="o">)</span> <span class="o">[</span><span class="n">SERVICE</span><span class="o">]</span> <span class="n">Enlisting</span> <span class="n">a</span> <span class="n">participant</span> <span class="n">into</span> <span class="n">the</span> <span class="n">BA</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">685</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">http</span><span class="o">-</span><span class="n">localhost</span><span class="o">-</span><span class="mf">127.0</span><span class="o">.</span><span class="mf">0.1</span><span class="o">-</span><span class="mi">8080</span><span class="o">-</span><span class="mi">2</span><span class="o">)</span> <span class="o">[</span><span class="n">SERVICE</span><span class="o">]</span> <span class="n">Invoking</span> <span class="n">the</span> <span class="n">back</span><span class="o">-</span><span class="n">end</span> <span class="n">business</span> <span class="n">logic</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">688</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">management</span><span class="o">-</span><span class="n">handler</span><span class="o">-</span><span class="n">threads</span> <span class="o">-</span> <span class="mi">10</span><span class="o">)</span> <span class="o">[</span><span class="n">CLIENT</span><span class="o">]</span> <span class="n">invoking</span> <span class="n">addValueToSet</span><span class="o">(</span><span class="mi">2</span><span class="o">)</span> <span class="n">on</span> <span class="n">WS</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">713</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">http</span><span class="o">-</span><span class="n">localhost</span><span class="o">-</span><span class="mf">127.0</span><span class="o">.</span><span class="mf">0.1</span><span class="o">-</span><span class="mi">8080</span><span class="o">-</span><span class="mi">2</span><span class="o">)</span> <span class="o">[</span><span class="n">SERVICE</span><span class="o">]</span> <span class="n">invoked</span> <span class="n">addValueToSet</span><span class="o">(</span><span class="s1">&#39;2&#39;</span><span class="o">)</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">713</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">http</span><span class="o">-</span><span class="n">localhost</span><span class="o">-</span><span class="mf">127.0</span><span class="o">.</span><span class="mf">0.1</span><span class="o">-</span><span class="mi">8080</span><span class="o">-</span><span class="mi">2</span><span class="o">)</span> <span class="o">[</span><span class="n">SERVICE</span><span class="o">]</span> <span class="n">Re</span><span class="o">-</span><span class="n">using</span> <span class="n">the</span> <span class="n">existing</span> <span class="n">participant</span><span class="o">,</span> <span class="n">already</span> <span class="n">registered</span> <span class="k">for</span> <span class="k">this</span> <span class="n">BA</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">713</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">http</span><span class="o">-</span><span class="n">localhost</span><span class="o">-</span><span class="mf">127.0</span><span class="o">.</span><span class="mf">0.1</span><span class="o">-</span><span class="mi">8080</span><span class="o">-</span><span class="mi">2</span><span class="o">)</span> <span class="o">[</span><span class="n">SERVICE</span><span class="o">]</span> <span class="n">Invoking</span> <span class="n">the</span> <span class="n">back</span><span class="o">-</span><span class="n">end</span> <span class="n">business</span> <span class="n">logic</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">756</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">management</span><span class="o">-</span><span class="n">handler</span><span class="o">-</span><span class="n">threads</span> <span class="o">-</span> <span class="mi">10</span><span class="o">)</span> <span class="o">[</span><span class="n">CLIENT</span><span class="o">]</span> <span class="n">Cancelling</span> <span class="n">Business</span> <span class="n">Activity</span> <span class="o">(</span><span class="n">This</span> <span class="n">will</span> <span class="n">cause</span> <span class="n">the</span> <span class="n">work</span> <span class="n">to</span> <span class="n">be</span> <span class="n">compensated</span><span class="o">)</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">815</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">TaskWorker</span><span class="o">-</span><span class="mi">3</span><span class="o">)</span> <span class="o">[</span><span class="n">SERVICE</span><span class="o">]</span> <span class="n">Participant</span><span class="o">.</span><span class="na">cancel</span> <span class="o">(</span><span class="n">The</span> <span class="n">participant</span> <span class="n">should</span> <span class="n">compensate</span> <span class="n">any</span> <span class="n">work</span> <span class="n">done</span> <span class="n">within</span> <span class="k">this</span> <span class="n">BA</span><span class="o">)</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">815</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">TaskWorker</span><span class="o">-</span><span class="mi">3</span><span class="o">)</span> <span class="o">[</span><span class="n">SERVICE</span><span class="o">]</span> <span class="n">SetParticipantBA</span><span class="o">:</span> <span class="n">Carrying</span> <span class="n">out</span> <span class="n">compensation</span> <span class="n">action</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">815</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">TaskWorker</span><span class="o">-</span><span class="mi">3</span><span class="o">)</span> <span class="o">[</span><span class="n">SERVICE</span><span class="o">]</span> <span class="n">Compensate</span> <span class="n">the</span> <span class="n">backend</span> <span class="n">resource</span> <span class="n">by</span> <span class="n">removing</span> <span class="s1">&#39;1&#39;</span> <span class="n">from</span> <span class="n">the</span> <span class="kd">set</span> <span class="o">(</span><span class="n">e</span><span class="o">.</span><span class="na">g</span><span class="o">.</span> <span class="n">undo</span> <span class="n">any</span> <span class="n">changes</span> <span class="n">to</span> <span class="n">databases</span> <span class="n">that</span> <span class="n">were</span> <span class="n">previously</span> <span class="n">made</span> <span class="n">visible</span> <span class="n">to</span> <span class="n">others</span><span class="o">)</span>
<span class="mi">16</span><span class="o">:</span><span class="mi">24</span><span class="o">:</span><span class="mi">19</span><span class="o">,</span><span class="mi">816</span> <span class="n">INFO</span>  <span class="o">[</span><span class="n">stdout</span><span class="o">]</span> <span class="o">(</span><span class="n">TaskWorker</span><span class="o">-</span><span class="mi">3</span><span class="o">)</span> <span class="o">[</span><span class="n">SERVICE</span><span class="o">]</span> <span class="n">Compensate</span> <span class="n">the</span> <span class="n">backend</span> <span class="n">resource</span> <span class="n">by</span> <span class="n">removing</span> <span class="s1">&#39;2&#39;</span> <span class="n">from</span> <span class="n">the</span> <span class="kd">set</span> <span class="o">(</span><span class="n">e</span><span class="o">.</span><span class="na">g</span><span class="o">.</span> <span class="n">undo</span> <span class="n">any</span> <span class="n">changes</span> <span class="n">to</span> <span class="n">databases</span> <span class="n">that</span> <span class="n">were</span> <span class="n">previously</span> <span class="n">made</span> <span class="n">visible</span> <span class="n">to</span> <span class="n">others</span><span class="o">)</span>
</pre></div>
<h2><a id="run-the-quickstart-in-jboss-developer-studio-or-eclipse" class="anchor" href="#run-the-quickstart-in-jboss-developer-studio-or-eclipse"><span class="anchor-icon"></span></a>Run the Quickstart in JBoss Developer Studio or Eclipse</h2>

<p>You can also start the server and deploy the quickstarts from Eclipse using JBoss tools. For more information, see <a href="../README.html#use-jboss-developer-studio-or-eclipse-to-run-the-quickstarts">Use JBoss Developer Studio or Eclipse to Run the Quickstarts</a> </p>

<h2><a id="debug-the-application" class="anchor" href="#debug-the-application"><span class="anchor-icon"></span></a>Debug the Application</h2>

<p>If you want to debug the source code or look at the Javadocs of any library in the project, run either of the following commands to pull them into your local repository. The IDE should then detect them.</p>
<div class="highlight"><pre>    <span class="n">mvn</span> <span class="n">dependency</span><span class="o">:</span><span class="n">sources</span>
    <span class="n">mvn</span> <span class="n">dependency</span><span class="o">:</span><span class="n">resolve</span> <span class="o">-</span><span class="n">Dclassifier</span><span class="o">=</span><span class="n">javadoc</span>
</pre></div></body></html>
